package nina.yiyou.salary.start

import java.nio.file.Path
import java.nio.file.Paths

class SalaryArgsParser {

  interface Result {

    Path workshopExcel()
  }

  SalaryArgsParser(String[] args) {
    _args = args
  }

  Result parse() {
    def outer = this
    return new Result() {
      @Override
      Path workshopExcel() {
        return outer.workshopExcel()
      }
    }
  }

  private Path workshopExcel() {
    return Paths.get(_args ? _args[0] :
        /D:\work\personal\nina\2020yiyou\nina_yiyou\nina_workshop\ninaworkshop_yiyou1.1.xlsm/
    )
  }

  private final String[] _args
}
